import { getHttp } from './http'

export async function userInfoApi() {
  const http = getHttp()
  return await http('/lobby/user/info', {
    method: 'GET',
  })
}
export async function vipListApi() {
  const http = getHttp()
  return await http('/lobby/vip/list', {
    method: 'GET',
  })
}
// export const registerApi = async (data: any) => {
//   const http = getHttp()
//   const res = await http('/account/user/register', {
//     method: 'Post',
//     body: data,
//   })
//   if (res.code === 0) {
//     return res.data
//   } else {
//     showFailToast(res.message);
//   }
// }
export const registerApi = async (data: any) => {
  const http = getHttp()
  return await http('/account/user/register', {
    method: 'POST',
    body: data,
  })
}
export const loginApi = async (data: any) => {
  const http = getHttp()
  return await http('/account/user/login', {
    method: 'Post',
    body: data,
  })
}
export const bindMobileApi = async (data: any) => {
  const http = getHttp()
  return await http('/lobby/user/bindMobile', {
    method: 'Post',
    body: data,
  })
}
export const codeApi = async (data: any) => {
  const http = getHttp()
  return await http('/account/user/sendSms', {
    method: 'Post',
    body: data,
  })
}
export const updateUserInfoApi = async (data: any) => {
  const http = getHttp()
  return await http('/lobby/user/updateBaseInfo', {
    method: 'Post',
    body: data,
  })
}